<template>
  
  <div class="lin__navHeader lin__navHeader_linedown">
    <div class="lin__navHeader_list">
      <div class="lin__navHeader_list_left">
        <a class="lin__navHeader_log" href="/">
          <img src="https://res.insta360.com/static/152c5357495e029a5b3904d8d2b5eea9/logo-black.svg" alt="LinStore">
        </a>
        <div class="lin__navHeader_list_left_title">
          <ul>
            <li @mouseover="ConsumerShow(0)" @mouseleave="ConsumerHide(0)">
              <a href="/product/Consumer">Consumer</a>
            </li>
            <li >
              <a href="#">Professional</a>
            </li>
            <li>
              <a href="#">Enterprise</a>
            </li>
            <li>
              <a href="#">Explore</a>
            </li>
            <li>
              <a href="#">Support</a>
            </li>
            <li>
              <a href="#">Downloads</a>
            </li>
            <li>
              <a href="#">About</a>
            </li>
          </ul>
        </div>
      </div>
      <div class="lin__navHeader_list_right">
        <div class="lin__navHeader_list_right_store">
          <a href="#">
            <span class="lin__navHeader_list_right_store_icon">
              <el-icon :size="17">
                <Handbag />
              </el-icon>
            </span>
            
            <span class="lin__navHeader_list_right_store_icon" style="left: 50px; top: -14px;">
              STORE
            </span>
          </a>
        </div>
        <div class="lin__navHeader_list_right_auther">
          <a href="/account/login">
            <span class="lin__navHeader_list_right_store_icon" style="top: -28px; left: -9px;">
              <el-icon :size="22">
                <User />
              </el-icon>
            </span>
          </a>
        </div>
        <div class="lin__navHeader_list_right_region">
          <a href="#" class="lin__navHeader_list_right_store_icon" style="top: 3px; left: 2px;">
            <img src="https://static.insta360.com/assets/storage/20200415/7f273ad2c55876014e4375d5752c971e/zh_cn_2x.png" alt="" style="height: 18px;">
          </a>
          <Region
            class="lin__navHeader_list_right_store_icon lin_region_change"

          />
        </div>
      </div>
    </div>
  </div>

  <NavBarPullDown
  :class="{NavBarPullDown: true}"
  />

  <Upload
  style="display: none;"
  />


  <div style="position: relative;" @mouseover="enterConsumer()" @mouseleave="hideConsumer()">
    <div class="consumerShow" >
      <ConsumerPullDown
        v-show="consumerShow"
        />
    </div>
  </div>



</template>



<script lang="ts">


  export default defineComponent({

    setup(){
      const data = reactive({
        isShow: ref(false),
        consumerShow: ref(false),
        Timeout: ref(),
        Event: ref(),
        isTransitioning: ref(false)
      })


      const startTimer = () => {
        return setTimeout(() => {
          console.log('关闭');
          
          data.consumerShow = false;
        }, 1000);
      }

      const clearTimer = () => {
        clearTimeout(data.Timeout);
        data.Timeout = null;
      };


      const ConsumerShow = (Event: any) => {
        clearTimeout(data.Timeout)
        if(!data.isTransitioning){
          data.consumerShow = true
        }
      }


      const ConsumerHide = (index: any) => {
        if(!data.Timeout){

          
          data.Timeout = startTimer()
        }
      }

      const enterConsumer = () => {
        clearTimer()
        if(!data.isTransitioning){
          data.consumerShow = true

        }
      }

  
      const hideConsumer = () => {
        ConsumerHide(0)
      }
      
      const handleTransitionEnd = () => {
        data.isTransitioning = false;
      };





      return{
        ...toRefs(data),
        ConsumerShow,
        ConsumerHide,
        enterConsumer,
        hideConsumer,
        startTimer,
        clearTimer,
        handleTransitionEnd
      }
    }
  })
  


</script>












<style scoped>

* {
  text-decoration: none;
  list-style: none;
  color: black;
}


.lin__navHeader {
  position: sticky;
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  height: 64px;
  top: 0;
  border-bottom: 1px solid rgb(223, 222, 222);
  z-index: 9999;
  background: white;
}


.lin__navHeader_list {
  display: flex;
  justify-content: space-evenly;
}

.lin__navHeader_list_left {
  display: flex;
  justify-content: space-evenly;
  text-align: center;
  line-height: 64px;
  width: 720px;

}

.lin__navHeader_log {
  position: absolute;
  text-align: left;
  top: 5px;
  left: -130px;
}

.lin__navHeader_log img{
  width: 100px;
}

.lin__navHeader_list_left_title {
  position: absolute;
  width: 100%;
  height: auto;
  top: -14px;
}

.lin__navHeader_list_left_title ul {
  display: flex;
  justify-content: space-between;
}

.lin__navHeader_list_left_title ul li {
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.1s; /* 添加过渡效果 */
}

.lin__navHeader_list_left_title a {
  font-size: 14px;
}


.lin__navHeader_list_left_title a::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -23px;
  border-bottom: 2px solid rgb(0, 0, 0); /* 下划线大小，颜色 */
  width: 0; /* 初始下划线宽度为0，悬停时变化 */
  height: 100%; /* 下划线高度，可以根据需要调整 */
  transition: all 0.3s; /* 添加过渡效果 */
}

.lin__navHeader_list_left_title a:hover::before{
  content: '';
  width: 100%;
  left: 4px;
  display: inline-block;
}

.lin__navHeader_list_right {
  display: flex;
  justify-content: space-evenly;
  line-height: 64px;
  margin-left: 200px;
}

.lin__navHeader_list_right_store a{
  background: linear-gradient(96.98deg, #fe0, #ffdf4d);
  padding: 10px  60px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: bolder;
}

.lin__navHeader_list_right_store_icon {
  position: absolute;
  left: 28px;
  top: -11px;
}

.lin__navHeader_list_right_auther {
  margin: auto 25px;
  
}


.lin_region_change {
  display: none;
  top: 54px;
  left: -65px;
  z-index: 998;
}

.lin_region_change:hover {
  display: block;
}

.lin__navHeader_list_right_region:hover .lin_region_change{
  display: block;
}


.NavBarPullDown {
  display: none;
}

.consumer {
  display: block;
}

.consumerShow {
  position: fixed;
  top: 60px;
  z-index: 2;
  transition: height 0.5s;
}


/* 响应式布局 - 当屏幕宽度小于或等于 600px 时 */
@media screen and (max-width: 1330px) {

  .lin__navHeader {
    display: none;
  }

  /* 将侧边栏隐藏 */
  .NavBarPullDown {
    position: fixed;
    top: 0;
    width: 100%;
    height: 64px;
    display: flex;
    z-index: 3;
  }

}




</style>